# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=pyogrio
pkgname=python-${_pkg}
pkgver=0.6.0
pkgrel=2
pkgdesc="Vectorized vector I/O using OGR"
arch=(loong64 x86_64)
url="https://pyogrio.readthedocs.io/"
license=(MIT)
depends=(gdal python-certifi python-numpy)
makedepends=(cython python-setuptools python-versioneer)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha256sums=('4b8f0666701766a7ac3774b6f1c5f8dd5d72f1ed18cb319790835d8f8d073ce5')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

# ModuleNotFoundError: No module named 'pyogrio._ogr' even when setting PYTHONPATH or using a venv
#check() {
#  cd ${_pkg}-${pkgver}
#  pytest -vv --color=yes
#}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
